using System.Collections;
using Rdl;

namespace GTame.ReportParser
{

    public class SubtotalType
    {

        private string _DataElementName;
        private Rdl.SubtotalTypeDataElementOutput _DataElementOutput;
        private Rdl.SubtotalTypePosition _Position;
        private GTame.ReportParser.ReportItemsTypeSingle _ReportItems;
        private GTame.ReportParser.StyleType _Style;

        public string DataElementName
        {
            get
            {
                return _DataElementName;
            }
            set
            {
                _DataElementName = value;
            }
        }

        public Rdl.SubtotalTypeDataElementOutput DataElementOutput
        {
            get
            {
                return _DataElementOutput;
            }
            set
            {
                _DataElementOutput = value;
            }
        }

        public Rdl.SubtotalTypePosition Position
        {
            get
            {
                return _Position;
            }
            set
            {
                _Position = value;
            }
        }

        public GTame.ReportParser.ReportItemsTypeSingle ReportItems
        {
            get
            {
                if (_ReportItems == null)
                    _ReportItems = new GTame.ReportParser.ReportItemsTypeSingle();
                return _ReportItems;
            }
            set
            {
                _ReportItems = value;
            }
        }

        public GTame.ReportParser.StyleType Style
        {
            get
            {
                if (_Style == null)
                    _Style = new GTame.ReportParser.StyleType();
                return _Style;
            }
            set
            {
                _Style = value;
            }
        }

        public SubtotalType()
        {
        }

        public Rdl.SubtotalType Write()
        {
            Rdl.SubtotalType subtotalType = new Rdl.SubtotalType();
            System.Collections.ArrayList arrayList = new System.Collections.ArrayList();
            if (_DataElementName != null)
                arrayList.Add(_DataElementName);
            arrayList.Add(_DataElementOutput);
            arrayList.Add(_Position);
            if (_ReportItems != null)
                arrayList.Add(_ReportItems.Write());
            if (_Style != null)
                arrayList.Add(_Style.Write());
            subtotalType.Items = arrayList.ToArray();
            arrayList = null;
            return subtotalType;
        }

    } // class SubtotalType

}

